var DOC_STATUS = "V_NAT";//发票状态栏，对应后台的status。

Ext.define('HIT.view.ExportWriteBackGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.exportfilepanel',

    cls: 'custom-grid',
    frame: false,
    width: 1200,
    columnLines: false,
    store: 'ExportWriteBack',

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
        	
            columns: [
                {
                    xtype: 'rownumberer',
                    resizable: true,
                    width: 30
                },
                {
                	xtype: 'gridcolumn',
                	id: '',
                	hidden:true
                },
                {
                    xtype: 'gridcolumn',
                    width: 120,
                    align: 'center',
                    dataIndex: 'document_no',
                    text: Share.T('单据号')
                },
                {
                    xtype: 'gridcolumn',
                    align: 'center',
                    width: 100,
                    format : 'Y-m-d',
                    dataIndex: 'document_date',
                    text: Share.T('单据日期')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'center',
                    dataIndex: 'cust_code',
                    text: Share.T('客户代码')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'cust_name_chn',
                    text: Share.T('客户／供应商')
                },
                   {
                    xtype: 'gridcolumn',
                    renderer: Ext.util.Format.numberRenderer('000,000,000.00'),
                    width: 100,
                    align: 'right',
                    dataIndex: 'total_amount',
                    style:'text-align:center;',
                    text: Share.T('金额')
                },
                   {
                    xtype: 'gridcolumn',
                    renderer: Ext.util.Format.numberRenderer('000,000,000.00'),
                    width: 100,
                    align: 'right',
                    dataIndex: 'tax_amount',
                    style:'text-align:center;',
                    text: Share.T('税额')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'cust_name_eng',
                    style:'text-align:center;',
                    text: Share.T('备注')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'tax_code',
                    style:'text-align:center;',
                    text: Share.T('税号')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'bank_account',
                    style:'text-align:center;',
                    text: Share.T('客户银行帐号')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'address',
                    text: Share.T('地址电话')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'center',
                    dataIndex: 'doc_status',
                    text: Share.T('状态')
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref01',
                    style:'text-align:center;',
                    text: Share.Ref[0]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'ref02',
                    text: Share.Ref[1]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'ref03',
                    text: Share.Ref[2]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'ref04',
                    text: Share.Ref[3]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref05',
                    style:'text-align:center;',
                    text: Share.Ref[4]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref06',
                    style:'text-align:center;',
                    text: Share.Ref[5]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref07',
                    style:'text-align:center;',
                    text: Share.Ref[6]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref08',
                    style:'text-align:center;',
                    text: Share.Ref[7]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'ref09',
                    text: Share.Ref[8]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref10',
                    style:'text-align:center;',
                    text: Share.Ref[9]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref11',
                    style:'text-align:center;',
                    text: Share.Ref[10]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref12',
                    style:'text-align:center;',
                    text: Share.Ref[11]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    style:'text-align:center;',
                    dataIndex: 'ref13',
                    text: Share.Ref[12]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref14',
                    style:'text-align:center;',
                    text: Share.Ref[13]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref15',
                    style:'text-align:center;',
                    text: Share.Ref[14]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref16',
                    style:'text-align:center;',
                    text: Share.Ref[15]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref17',
                    style:'text-align:center;',
                    text: Share.Ref[16]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref18',
                    style:'text-align:center;',
                    text: Share.Ref[17]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref19',
                    style:'text-align:center;',
                    text: Share.Ref[18]
                },
                {
                    xtype: 'gridcolumn',
                    width: 100,
                    align: 'left',
                    dataIndex: 'ref20',
                    style:'text-align:center;',
                    text: Share.Ref[19]
                }
            ],
            viewConfig: {
                enableTextSelection:true
            },
            selModel: Ext.create('Ext.selection.CheckboxModel', {
            	checkOnly: false
            }), 
//            plugins :[{ptype:"rowselectionpaging"}],
            dockedItems: [
                {
                    xtype: 'pagingtoolbar',
                    dock: 'bottom',
                    inputItemWidth:45,
                    width: 360,
                    displayInfo: true,
                    store: 'ExportWriteBack',
                    plugins: [{
                        ptype: "pagesize",
                        uxPageSize: page_size}]
                },
                {
                	xtype: 'textfield',
                	id : 'writeback-invtype',
                	value : 'N_VAT',
                	hidden : true
                },
                {
                	xtype: 'textfield',
                	id : 'writeback-invstatus_select',
                	hidden : true
                }
            ]
        });               
        me.callParent(arguments);
    }
});